In computer-based image manipulation and editing systems, it is a common practice to extract people or objects, termed the "foreground", from a scene, and insert or composite them into or on top of a second image termed the "background" image. In general, these two images are from different sources. Without special treatment, undesirable boundary artifact may result along the boundaries between the "foreground" and the "background" in the composite image. In other words, the "foreground" does not blend smoothly with the new "background". The artifact is particularly pronounced where the boundary has an arbitrary shape, and where there are arbitrarily different color patches or textured patches across the boundary, due to the quantization of the image data in terms of limited number of code values, as well as the sampling in terms of limited spatial resolution. This problem is also referred to as "aliasing". One possible solution to the problem of boundary artifact reduction is called "feathering", i.e. locally blurring the boundary between the "foreground" and the "background."
However, another obvious problem may arise for many feathering techniques. It is noticed that the boundary of the foreground people/objects may not have the same focus characteristics, in particular for close-up shots. Moreover, some segments of the foreground boundary may not have the same sharpness as other segments that are in equally good focus due to the physical reflectance properties of the material. For example, the border of hair, mustache, wool, beard, or feather generally appear "fuzzy." In fact, "feathering" is an operation named after the process to create a feather looking effect. Also, some segments of the boundary may appear blurred due to motion. Typically, operators use a "compromising" feathering factor due to the fact that the boundary between the foreground and background includes different characteristics that vary along the boundary. Even though such a compromising blurring factor is applied, frequently, this does not adequately compensate for the boundary differences because it uses a constant feathering factor.
U.S. Pat. No. 5,022,085 describes a technique for neighborhood-based merging of image data. The technique employs a "feathering" window containing a number of neighboring pixel locations over which the pixel values of the foreground are controllably modified to achieve a tapered blending of the foreground and the background. Whether the data value for a pixel within the editing canvas is to be modified depends on whether or not the pixel location is both within the foreground and a prescribed distance to the boundary of the foreground. In summary, the feathering coefficient as disclosed in U.S. Pat. No. 5,022,085 is determined by the ratio of the number of foreground pixels and the number of background pixels within the feathering window. Therefore, the extent to which feathering takes place depends on how close the pixel is to the border of the foreground image. This technique performs a gradual blending of the foreground image along its border with the background image. However, the composited image may still look less than realistic if one notices that the boundary of the foreground has almost the same focus characteristics everywhere along the boundary because the boundary pixels are all blended in the same way. In other words, the feathering function has the same shape everywhere along the foreground boundary.